<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http：//www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>New Web Project</title>
	</head>
	<body>
		<form id="formTab2">
			<fieldset>
				<legend>
					门急诊诊断信息
				</legend>
				<table class="layout-table">
					<colgroup>
						<col width="20%"/>
						<col width="30%"/>
						<col width="20%"/>
						<col width="30%"/>
					</colgroup>
					<tbody>
						<tr>
							<td align="right"><label for="ABA01C">门(急)诊诊断编码(ICD-10)：</label></td>
							<td>
							<input id="ABA01C" name="ABA01C" type="text" class="easyui-validatebox" validType="fixedin[zdData,'code']"/>
							</td>
							<td></td><td></td>
						</tr>
						<tr>
							<td align="right"><label for="ABA01N">门（急）诊诊断名称：</label></td>
							<td colspan="3">
							<input id="ABA01N" name="ABA01N" type="text" class="easyui-validatebox longtext" validType="fixedin[zdData,'name']"/>
							</td>
							<script type="text/javascript">
							$(function(){
		               			$("#ABA01C").autocomplete(zdData, {
		                   			autoFill: false,
									matchContains:true,
		                   			formatItem: function(item){
		                   				return item.code+"("+item.name+")";
		                 			},
									formatResult:function(item,i,max){
										return item.code;
									},
									formatMatch:function(row,i,max){
										return row.code+" "+row.name+" "+row.pym
									}
		              			}).result(function(event, item) {
		              				item = item||{};
		  							$("#ABA01N").val(item.name);
		  							$("#ABA01N").validatebox("validate");
			           			});
					   			$("#ABA01N").autocomplete(zdData, {
		       	 					autoFill: false,
									matchContains:true,
		        					formatItem: function(item){
										return item.name+"("+item.code+")";
		        					},
									formatResult:function(item,i,max){
										return item.name;
									},
									formatMatch:function(item){
										return item.code+item.name+item.pym
									}
		    					}).result(function(event, item){
		    						item = item||{};
		       						$("#ABA01C").val(item.code);
		       						$("#ABA01C").validatebox("validate");
		    					});
		            		});
							</script>
						</tr>
					</tbody>
				</table>
			</fieldset>
			<fieldset>
				<legend>
					出院主要诊断信息
				</legend>
				<table class="layout-table">
					<colgroup>
						<col width="20%"/>
						<col width="30%"/>
						<col width="20%"/>
						<col width="30%"/>
					</colgroup>
					<tbody>
						<tr>
							<td align="right" ><label for="ABC01C">出院时主要诊断编码(ICD-10)：</label></td>
							<td>
							<input id="ABC01C" name="ABC01C" type="text" class="easyui-validatebox"  required="true" validType="fixedin[zdData,'code']"/>
							</td>
							<td></td><td></td>
						</tr>
						<tr>
							<td align="right"><label for="ABC01N">出院主要诊断名称：</label></td>
							<td colspan="3">
							<input id="ABC01N" name="ABC01N" type="text" class="easyui-validatebox longtext" validType="fixedin[zdData,'name']"  required="true"/>
							</td>
						</tr>
						<script type="text/javascript">
					$(function(){
               			$("#ABC01C").autocomplete(zdData, {
                   			//mustMatch: true,
                   			autoFill: false,
							matchContains:true,
                   			formatItem: function(item){
                   				return item.code+"("+item.name+")";
                 			},
							formatResult:function(item,i,max){
								return item.code;
							},
							formatMatch:function(row,i,max){
								return row.code+" "+row.name+" "+row.pym
							}
              			}).result(function(event, item) {
              				item = item||{};
  							$("#ABC01N").val(item.name);
  							$("#ABC01N").validatebox("validate");
  							//肿瘤作为主诊时，编码范围在C00~D48,病理诊断编码为必填。
							if(item.code&&item.code>="C00"&&item.code<"D49"){
								$("#ABF01C,#ABF01N").validatebox({required:true});
								$("#ABF01C,#ABF01N").validatebox("validate");
							}else{
								$("#ABF01C,#ABF01N").validatebox({required:false});
								$("#ABF01C,#ABF01N").validatebox("validate");
							}
  							//损伤中毒作为主诊时，编码范围在S00 – T98, 损伤外部原因必填
							if(item.code&&item.code>="S00"&&item.code<"T99"){
								$("#ABG01C,#ABG01N").validatebox({required:true});
								$("#ABG01C,#ABG01N").validatebox("validate");
							}else{
								$("#ABG01C,#ABG01N").validatebox({required:false});
								$("#ABG01C,#ABG01N").validatebox("validate");
							}
	           			});
			   			$("#ABC01N").autocomplete(zdData, {
        					//mustMatch: true,
       	 					autoFill: false,
							matchContains:true,
        					formatItem: function(item){
								return item.name+"("+item.code+")";
        					},
							formatResult:function(item,i,max){
								return item.name;
							},
							formatMatch:function(item){
								return item.code+item.name+item.pym
							}
    					}).result(function(event, item){
    						item = item||{};
     						$("#ABC01C").val(item.code);
     						$("#ABC01C").validatebox("validate");
       						//肿瘤作为主诊时，编码范围在C00~D48,病理诊断编码为必填。
 							if(item.code&&item.code>="C00"&&item.code<"D49"){
 								$("#ABF01C,#ABF01N").validatebox({required:true});
 								$("#ABF01C,#ABF01N").validatebox("validate");
 							}else{
 								$("#ABF01C,#ABF01N").validatebox({required:false});
 								$("#ABF01C,#ABF01N").validatebox("validate");
 							}
   							//损伤中毒作为主诊时，编码范围在S00 – T98, 损伤外部原因必填
 							if(item.code&&item.code>="S00"&&item.code<"T99"){
 								$("#ABG01C,#ABG01N").validatebox({required:true});
 								$("#ABG01C,#ABG01N").validatebox("validate");
 							}else{
 								$("#ABG01C,#ABG01N").validatebox({required:false});
 								$("#ABG01C,#ABG01N").validatebox("validate");
 							}
    					});
            		});
					</script>
						<tr>
							<td align="right"><label for="ABC03C">入院病情：</label></td>
							<td>
							<input id="ABC03C" name="ABC03C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-RuYuanBingQing.json" panelHeight="auto" required="true" validType="comboboxfixed['ABC03C']"/>
							</td>
							<td></td><td></td>
						</tr>
					</tbody>
				</table>
			</fieldset>
			<fieldset>
				<legend>出院其他诊断信息</legend>
				<script type="text/javascript">
						$(function() {
							$('#ABDS').initGrid();
						});
						function ABD01C_resultHandler(event, item){
							item = item||{};
							var target = event.currentTarget;
							var el = $(target).parent().parent().parent().parent().parent().parent().next().find("input");
							el.val(item.name);
							el.validatebox("validate");
						}
						function ABD01N_resultHandler(event, item){
							item = item||{};
							var target = event.currentTarget;
							var el = $(target).parent().parent().parent().parent().parent().parent().prev().find("input");
							el.val(item.code);
							el.validatebox("validate");
						}
						function rybq_Formatter(value){
							for(var i=0; i<dic_rybq.length; i++){
								if (dic_rybq[i].value == value) return dic_rybq[i].text;
							}
							return value;
						}

					</script>
					<table id="ABDS" style="height:180px;" title="出院其他诊断信息" singleSelect="true" rownumbers="true">
						<thead>
							<tr>
								<th field="ABD01C" width="200" align="center" editor="{type:'autocompletebox',options:{source:zdData,autoFill : false,matchContains: true,formatItem: function(item){return item.code+'('+item.name+')';},formatResult:function(item,i,max){return item.code;},formatMatch:function(row,i,max){return row.code+row.name+row.pym},resultHandler:ABD01C_resultHandler,required:true,validType:'fixedin[zdData,\'code\']'}}"> 出院时其他诊断编码(ICD-10) </th>
								<th field="ABD01N" width="400" align="center" editor="{type:'autocompletebox',options:{source:zdData,autoFill : false,matchContains: true,formatItem: function(item){return item.name+'('+item.code+')';},formatResult:function(item,i,max){return item.name;},formatMatch:function(row,i,max){return row.code+row.name+row.pym},resultHandler:ABD01N_resultHandler,required:true,validType:'fixedin[zdData,\'name\']'}}"> 出院其他诊断名称 </th>
								<th field="ABD03C" width="100" align="center" formatter="rybq_Formatter" editor="{type:'combobox',options:{required:true,data:dic_rybq,panelHeight:'auto',editable:false}}"> 入院病情 </th>
							</tr>
						</thead>
					</table>
			</fieldset>
			<fieldset>
				<legend>
					病理诊断信息
				</legend>
				<table class="layout-table">
					<colgroup>
						<col width="20%"/>
						<col width="30%"/>
						<col width="20%"/>
						<col width="30%"/>
					</colgroup>
					<tbody>
						<tr>
							<td align="right"><label for="ABF01C">病理诊断编码(M码)：</label></td>
							<td>
							<input id="ABF01C" name="ABF01C" type="text" class="easyui-validatebox" validType="fixedin[Dic_BLZD,'code']"/>
							</td>
							<td></td><td></td>
						</tr>
						<tr>
							<td align="right"><label for="ABF01N">病理诊断名称：</label></td>
							<td colspan="3">
							<input id="ABF01N" name="ABF01N" type="text" class="easyui-validatebox longtext" validType="fixedin[Dic_BLZD,'name']"/>
							</td>
							<script type="text/javascript">
					$(function(){
               			$("#ABF01C").autocomplete(Dic_BLZD, {
                   			autoFill: false,
                   			matchContains:true,
                   			formatItem: function(item){
                   				return item.code+"("+item.name+")";
                 			},
							formatResult:function(item,i,max){
								return item.code;
							},
							formatMatch:function(row,i,max){
								return row.code+" "+row.name+" "+row.pym
							}
              			}).result(function(event, item) {
              				item = item||{};
  							$("#ABF01N").val(item.name);
  							$("#ABF01N").validatebox("validate");
	           			});
			   			$("#ABF01N").autocomplete(Dic_BLZD, {
       	 					autoFill: false,
        					matchContains:true,
        					formatItem: function(item){
								return item.name+"("+item.code+")";
        					},
							formatResult:function(item,i,max){
								return item.name;
							},
							formatMatch:function(item){
								return item.code+item.name+item.pym
							}
    					}).result(function(event, item){
    						item = item||{};
       						$("#ABF01C").val(item.code);
       						$("#ABF01C").validatebox("validate");
    					});
            		});
					</script>
						</tr>
						<tr>
							<td align="right"><label for="ABF04">病理号：</label></td>
							<td>
							<input id="ABF04" name="ABF04" type="text" class="easyui-validatebox" validType="length[0,50]"/>
							</td>
							<td align="right"><label for="ABF02C">最高诊断依据代码：</label></td>
							<td>
							<input id="ABF02C" name="ABF02C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-diagnostic-evidence.json" validType="comboboxfixed['ABF02C']"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="ABF03C">分化程度编码：</label></td>
							<td>
							<input id="ABF03C" name="ABF03C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-FenHuaChengDu.json" validType="comboboxfixed['ABF03C']"/>
							</td>
							<td></td><td></td>
						</tr>
					</tbody>
				</table>
			</fieldset>
			<fieldset>
				<legend>
					损伤中毒诊断信息
				</legend>
				<table class="layout-table">
					<colgroup>
						<col width="20%"/>
						<col width="30%"/>
						<col width="20%"/>
						<col width="30%"/>
					</colgroup>
					<tbody>
						<tr>
							<td align="right"><label for="ABG01C">损伤和中毒外部原因编码(ICD-10)：</label></td>
							<td>
							<input id="ABG01C" name="ABG01C" type="text" class="easyui-validatebox" validType="fixedin[zdData,'code']"/>
							</td>
							<td></td><td></td>
						</tr>
						<tr>
							<td align="right"><label for="ABG01N">损伤和中毒外部原因名称：</label></td>
							<td colspan="3">
							<input id="ABG01N" name="ABG01N" type="text" class="easyui-validatebox longtext" validType="fixedin[zdData,'name']"/>
							</td>
						</tr>
						<script type="text/javascript">
					$(function(){
               			$("#ABG01C").autocomplete(zdData, {
                   			autoFill: false,
							matchContains:true,
                   			formatItem: function(item){
                   				return item.code+"("+item.name+")";
                 			},
							formatResult:function(item,i,max){
								return item.code;
							},
							formatMatch:function(row,i,max){
								return row.code+" "+row.name+" "+row.pym
							}
              			}).result(function(event, item) {
              				item = item||{};
  							$("#ABG01N").val(item.name);
  							$("#ABG01N").validatebox("validate");
	           			});
			   			$("#ABG01N").autocomplete(zdData, {
       	 					autoFill: false,
							matchContains:true,
        					formatItem: function(item){
								return item.name+"("+item.code+")";
        					},
							formatResult:function(item,i,max){
								return item.name;
							},
							formatMatch:function(item){
								return item.code+item.name+item.pym
							}
    					}).result(function(event, item){
    						item = item||{};
       						$("#ABG01C").val(item.code);
       						$("#ABG01C").validatebox("validate");
    					});
            		});
					</script>
					</tbody>
				</table>
			</fieldset>
			<fieldset>
				<legend>
					肿瘤分期
				</legend>
				<table class="layout-table">
					<colgroup>
						<col width="20%"/>
						<col width="30%"/>
						<col width="20%"/>
						<col width="30%"/>
					</colgroup>
					<tbody>
						<tr>
							<td align="right"><label for="ABH01C">肿瘤分期是否不详：</label></td>
							<td>
							<input id="ABH01C" name="ABH01C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-bool.json" panelHeight="auto" validType="comboboxfixed['ABH01C']"/>
							</td>
							<td align="right"><label for="ABH0201C">肿瘤分期 T：</label></td>
							<td>
							<input id="ABH0201C" name="ABH0201C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-TNM-T.json" panelHeight="auto" validType="comboboxfixed['ABH0201C']"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="ABH0202C">肿瘤分期 N：</label></td>
							<td>
							<input id="ABH0202C" name="ABH0202C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-TNM-N.json" panelHeight="auto" validType="comboboxfixed['ABH0202C']"/>
							</td>
							<td align="right"><label for="ABH0203C">肿瘤分期 M：</label></td>
							<td>
							<input id="ABH0203C" name="ABH0203C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-TNM-M.json" panelHeight="auto" validType="comboboxfixed['ABH0203C']"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="ABH03C">0～Ⅳ肿瘤分期：</label></td>
							<td>
							<input id="ABH03C" name="ABH03C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-ZhongLiuFenQi.json" panelHeight="auto" validType="comboboxfixed['ABH03C']"/>
							</td>
							<td></td><td></td>
						</tr>
					</tbody>
				</table>
				<script type="text/javascript">
					$(function(){
						$("#ABH01C").combobox({
							onSelect: function(record){
								var val = $(this).combobox("getValue");
								if(val=="2"){
									$("#ABH0201C,#ABH0202C,#ABH0203C,#ABH03C").combobox({required:true});
								}else{
									$("#ABH0201C,#ABH0202C,#ABH0203C,#ABH03C").combobox({required:false});
								}
							}
						});
					});
				</script>
			</fieldset>
		</form>
	</body>
</html>
